********************************************************************************
* Fight or Flight: Endogenous timing in conflicts ******************************
* Boris van Leeuwen, Theo Offerman & Jeroen van de Ven *************************
* June 26, 2020 ****************************************************************
********************************************************************************

This file describes how the analyses reported in the paper can be reproduced.


********************************************************************************
* Description of files *********************************************************
********************************************************************************

The raw data is contained in two CSV files:
1.	fof_subjects.csv contains data at the subject level
2.	fof_results.csv contains data on decisions in the main part of the experiment

Two Stata DO-files are provided to replicate the results. Stata/MP 16.1 was used.
1.	dataprep.do imports and combines the data into a single file for the analyses. Also, some useful variables are generated. This file needs to be run first.
2.	fof.do contains all the analyses to reproduce tests, figures and tables reported in the paper.

One Matlab file is provided to estimate the individual cutoff strategies reported in Appendix D. Matlab R2019a was used.
1. 	cutpoints_endo.m contains the script to estimate the cutoffs. It requires two input files (actions.xls and strengths.xls) which are generated with fof.do. The output of the Matlab estimations (also contained in cutoffs_final20.xlsx) in turn is needed in fof.do.


********************************************************************************
* Description of variables *****************************************************
********************************************************************************

1.	fof_subjects.csv
ppnr				subject id used in a session
totverdeuros			amount earned in the experiment in euros
mgroep				matching group number
session				session number
treatment			endo = dynamic; exo = static
studie				major field of study: econ = Economics or Business; psy = Psychology; law = Law; anders = Different
age				age in years
sexe				sex: vrouw = female; man = male
strength			maximum amount pushed (kg) in the physical strength task (Experiment 1 only)
masculinity			self-rated masculinity, "On a scale from 1 (very feminine) to 7 (very masculine), how would you describe yourself?"
lotterya-lotteryf		indicates which lotteries were accepted/rejected 
					
*the questions below are from the dominance/prestige measures of Cheng et al. (2010). All were answered on a 7-point Likert scale. This was asked: Please indicate the extent to which each statement accurately describes you by selecting the appropriate number on the scales below. (1=not at all, 4=somewhat, 7=very much)
q1				Members of my peer group respect and admire me.
q2				Members of my peer group do NOT want to be like me.
q3				I enjoy having control over others.
q4				Others always expect me to be successful.
q5				I often try to get my own way regardless of what others may want.
q6				Others do NOT value my opinion.
q7				I am willing to use aggressive tactics to get my way.
q8				I am held in high esteem by those I know.
q9				I try to control others rather than permit them to control me.
q10				I do NOT have a forceful or dominant personality.
q11				Others know it is better to let me have my way.
q12				I do NOT enjoy having authority over other people.
q13				My unique talents and abilities are recognized by others.
q14				I am considered an expert on some matters by others.
q15				Others seek my advice on a variety of matters.
q16				Some people are afraid of me.
q17				Others do NOT enjoy hanging out with me.
subjectid			unique subject id
inactive			subject was inactive (no response/technical issues) at some point during the online experiment (Experiment 2) if 1, 0 otherwise		
mistakes			number of mistakes in the practice questions (Experiment 2 only)
contest				incentivized joy-of-winning measure, number of points bid in the contest for a 0 points prize (Sheremeta 2010, 2018), Experiment 2 only
q18				non-incentvized joy-of-winning measure: "I enjoy winning an amount by competing against another person more than I enjoy receiving that same amount without having to compete for it."
k 				deterrence value 

2.	fof_results.csv
rol				used for tie-breaking (if two people chose FLIGHT in the same period)
round				round 
ppother				id of matched subject (defined per session)
ability 			fighting ability (0-1000)
ability_other			fighting ability (0-1000) of the matched subject
verdiensten			points earned in this round
decision 			endo = dynamic, before endgame; exo = static or endgame in dynamic (Experiment 1 only)
mymove				decision: fight = fight; flight = flee; none = other moved first; oth_inactiv = matched subject was inactive (Experiment 2 only)
othermove			decision of matched suject: fight = fight; flight = flee; none = other moved first; oth_inactiv = matched subject was inactive (Experiment 2 only)
tijd				decision time (in ms)
canflight			1 if a subject who flees at the same time the other fights manages to escape, 0 if not
tie 				indicates whether or not subjects moved in the same period in the dynamic games; 0 if not (only one subject moved, the other was still waiting); 1 indicates that the other moved in a later period; 2 indicates that the other moved in an earlier (time) period; 3 indicates that both moved in the same (time) period
subjectid			unique subject id
timeperiod			period that decision was made in (Experiment 2 only)
second 				second within a round the decision was made in (Experiment 2 only)